package cn.consult.controller.sys.apartment;

import cn.consult.common.api.CommonResult;
import cn.consult.sys.entity.T_WeInfo;
import cn.consult.sys.service.T_WeInfoService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ Author：周xx
 * @ Date：2024-04-17-15:19
 * @ Version：1.0
 * @ Description：
 */
@RestController
@RequestMapping("/info")
public class InfoController {


    @Autowired
    T_WeInfoService tWeInfoService;

    @GetMapping("/select")
    public CommonResult select(String number) {
        LambdaQueryWrapper<T_WeInfo> infoLambdaQueryWrapper = new LambdaQueryWrapper<>();
        infoLambdaQueryWrapper.eq(number != "" && number != null, T_WeInfo::getRoomNumber, number);
        List<T_WeInfo> list = tWeInfoService.list(infoLambdaQueryWrapper);
        return CommonResult.success(list);
    }
}
